Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] Print console warning when setting non-existent locales #4085

Merged
merged 5 commits into from
Mar 2, 2018

Conversation

asulaiman
Copy link
Contributor

Right now if the new locale being set is not available then it fails silently and just uses the existing global locale. A console warning would be useful to notify the user of such a failure.

Right now if the new locale being set is not available then it fails silently and just uses the existing global locale. A console warning would be useful to notify the user of such a failure.
@ichernev
Copy link
Contributor

ichernev commented Aug 3, 2017

@asulaiman if you want to use console.warn you should do it extremely carefully like here :

(typeof console !== 'undefined') && console.warn) {

@ichernev ichernev changed the title Dont silently fail setting new locale when it isnt available [misc] Print console warning when setting non-existant locales Aug 3, 2017
@asulaiman
Copy link
Contributor Author

@ichernev Ive added the console warn checks. Not sure if they are really needed because console console.warn are fairly big dependencies in JS that i dont see going away but i get it that we should be doing this regardless for consistency.

@ichernev
Copy link
Contributor

@asulaiman you're also missing a space after key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants